Gef.gef.tracker.BrowserListener = Gef.extend(Object, {
			constructor : function($) {
				this.graphicalViewer = $;
				this.selectionManager = new Gef.gef.tracker.SelectionManager(this);
				this.enabled = true;
				this.dragging = false;
				this.activeTracker = null;
				this.initTrackers();
				this.initEvents()
			},
			initTrackers : function() {
				this.trackers = [];
				if (Gef.editable !== false) {
					this.trackers.push(new Gef.gef.tracker.KeyPressRequestTracker(this));
					this.trackers.push(new Gef.gef.tracker.DirectEditRequestTracker(this));
					this.trackers.push(new Gef.gef.tracker.ToolTracker(this));
					this.trackers.push(new Gef.gef.tracker.CreateNodeRequestTracker(this));
					this.trackers.push(new Gef.gef.tracker.CreateEdgeRequestTracker(this));
					this.trackers.push(new Gef.gef.tracker.ResizeNodeRequestTracker(this));
					this.trackers.push(new Gef.gef.tracker.ResizeEdgeRequestTracker(this));
					this.trackers.push(new Gef.gef.tracker.MoveEdgeRequestTracker(this));
					this.trackers.push(new Gef.gef.tracker.MoveNodeRequestTracker(this));
					this.trackers.push(new Gef.gef.tracker.MoveTextRequestTracker(this));
					this.trackers.push(new Gef.gef.tracker.MarqueeRequestTracker(this))
				}
				this.selectionRequestTracker = new Gef.gef.tracker.SelectionRequestTracker(this);
				this.selectionListenerTracker = new Gef.gef.tracker.SelectionListenerTracker(this)
			},
			initEvents : function() {
				this.initMouseDownEvent();
				this.initMouseMoveEvent();
				this.initMouseUpEvent();
				this.initDoubleClickEvent();
				this.initKeyDownEvent();
				this.initKeyUpEvent()
			},
			initMouseDownEvent : function() {
				var $ = this, _ = function(A) {
					var _ = Gef.isIE ? event : A;
					$.mouseDown(_)
				};
				if (Gef.isIE)
					document.attachEvent("onmousedown", _);
				else
					document.addEventListener("mousedown", _, false)
			},
			initMouseMoveEvent : function() {
				var $ = this, _ = function(A) {
					var _ = Gef.isIE ? event : A;
					$.mouseMove(_)
				};
				if (Gef.isIE)
					document.attachEvent("onmousemove", _);
				else
					document.addEventListener("mousemove", _, false)
			},
			initMouseUpEvent : function() {
				var $ = this, _ = function(A) {
					var _ = Gef.isIE ? event : A;
					$.mouseUp(_)
				};
				if (Gef.isIE)
					document.attachEvent("onmouseup", _);
				else
					document.addEventListener("mouseup", _, false)
			},
			initDoubleClickEvent : function() {
				var $ = this, doubleFun = function(A) {
					var method = Gef.isIE ? event : A;
					$.doubleClick(method)
				};
				if (Gef.isIE)
					document.attachEvent("ondblclick", doubleFun);
				else
					document.addEventListener("dblclick", doubleFun, false)
			},
			initKeyDownEvent : function() {
				var $ = this, _ = function(A) {
					var _ = Gef.isIE ? event : A;
					$.keyDown(_)
				};
				if (Gef.isIE)
					document.attachEvent("onkeydown", _);
				else
					document.addEventListener("keydown", _, false)
			},
			initKeyUpEvent : function() {
				var $ = this, _ = function(A) {
					var _ = Gef.isIE ? event : A;
					$.keyUp(_)
				};
				if (Gef.isIE)
					document.attachEvent("onkeyup", _);
				else
					document.addEventListener("keyup", _, false)
			},
			fireEvent : function(E, A) {
				if (this.enabled !== true)
					return;
				var _ = this.getXY(A), D = this.getTarget(A), B = {
					e : A,
					eventName : E,
					point : _,
					target : D
				};
				try {
					if (this.selectionRequestTracker.understandRequest(B))
						this.selectionRequestTracker.processRequest(B)
				} catch (C) {
					Gef.error(C, "select")
				}
				try {
					if (this.activeTracker == null)
						Gef.each(this.trackers, function($) {
									var _ = !$.understandRequest(B);
									return _
								}, this);
					if (this.activeTracker != null) {
						var $ = this.activeTracker.processRequest(B);
						if ($)
							this.stopEvent(A)
					}
				} catch (C) {
					Gef.error(C, "fireEvent")
				}
				try {
					if (this.selectionListenerTracker.understandRequest(B))
						this.selectionListenerTracker.processRequest(B)
				} catch (C) {
					Gef.error(C, "selectlistener")
				}
			},
			mouseDown : function($) {
				this.fireEvent("MOUSE_DOWN", $)
			},
			mouseMove : function($) {
				this.fireEvent("MOUSE_MOVE", $)
			},
			mouseUp : function($) {
				this.fireEvent("MOUSE_UP", $)
			},
			doubleClick : function($) {
				this.fireEvent("DBL_CLICK", $)
			},
			keyDown : function($) {
				this.fireEvent("KEY_DOWN", $)
			},
			keyUp : function($) {
				this.fireEvent("KEY_UP", $)
			},
			getXY : function($) {
				var _ = {};
				if (typeof window.pageYOffset != "undefined") {
					_.x = window.pageXOffset;
					_.y = window.pageYOffset
				} else if (typeof document.compatMode != "undefined" && document.compatMode != "BackCompat") {
					_.x = document.documentElement.scrollLeft;
					_.y = document.documentElement.scrollTop
				} else if (typeof document.body != "undefined") {
					_.x = document.body.scrollLeft;
					_.y = document.body.scrollTop
				}
				var C = this.graphicalViewer.getCanvasLocation(), B = $.clientX + _.x, A = $.clientY + _.y;
				return {
					x : B - C.x,
					y : A - C.y,
					absoluteX : B,
					absoluteY : A
				}
			},
			getTarget : function($) {
				return Gef.isIE ? $.srcElement : $.target
			},
			stopEvent : function($) {
				if (Gef.isIE)
					$.returnValue = false;
				else
					$.preventDefault()
			},
			getViewer : function() {
				return this.graphicalViewer
			},
			getSelectionManager : function() {
				return this.selectionManager
			},
			disable : function() {
				this.enabled = false
			},
			enable : function() {
				this.enabled = true
			}
		});